package qianting.news.article.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.comment.dtos.CommentRepayDto;
import qianting.news.apis.models.comment.dtos.CommentRepayLikeDto;
import qianting.news.apis.models.comment.dtos.CommentRepaySaveDto;
import qianting.news.article.service.CommentRepayService;
import qianting.news.common.entity.State;

@Api(tags = "评论回复管理")
@RestController
@RequestMapping("/comment_repay")
public class CommentRepayController{


    @Autowired
    private CommentRepayService commentRepayService;

    @ApiOperation(value = "加载评论回复")
    @PostMapping("/load")
    public State loadCommentRepay(@RequestBody CommentRepayDto dto){
        return commentRepayService.loadCommentRepay(dto);
    }

    @ApiOperation(value = "保存评论回复")
    @PostMapping("/save")
    public State saveCommentRepay(@RequestBody CommentRepaySaveDto dto){
        return commentRepayService.saveCommentRepay(dto);
    }

    @ApiOperation(value = "点赞评论回复")
    @PostMapping("/like")
    public State saveCommentRepayLike(@RequestBody CommentRepayLikeDto dto){
        return commentRepayService.saveCommentRepayLike(dto);
    }

}